<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <title>活动列表</title>
    <%include ../../common.ejs%>

    <style>
        .table-div .caption {
            font-size: 30px;

        }

        .table-div {

            /*margin: 40px;*/
        }

        .input-costom {

            width: 130px;;
        }
    </style>

</head>
<body>
<div id="top">
    <% include ../top.ejs%>
</div>
<div class="container-fluid" style="margin-top: 20px;">
    <div class="row">
        <div class="col-md-1">
        </div>
        <div id="left" class="col-md-2">
            <% include ../left.ejs%>
        </div>
        <div class="col-md-8 bodyDiv" id="right">
            <div class="table-div">
                <span class="caption">与我有关的活动</span>

                <div class="row">
                    <form action="/customer/active/applyInvited" method="get">
                        <div class="col-md-6"></div>
                        <div class="col-md-2">
                            <div class="dropdown">
                                <select class="form-control">
                                    <option value="活动主题">活动主题</option>
                                </select>
                            </div>

                        </div>

                        <div class="col-md-2  input-costom ">
                            <input type="text" name="subject" class="form-control" value="<%= param %>">
                        </div>
                        <div class="col-md-2">
                            <button type="submit" class="btn btn-default">搜索</button>
                        </div>
                    </form>
                </div>
                <table class="table table-striped">

                    <thead>
                    <tr>
                        <th>活动主题</th>
                        <th>开始日期</th>
                        <th>结束日期</th>
                        <th>活动状态</th>
                        <th>报名/申请状态</th>
                        <th>活动地点</th>
                        <th>邀请/申请时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <% if(actives.length>0){%>
                        <% for(var i=0;i <actives.length;i++){ %>
                        <tr>
                            <td>
                                <a href="/customer/active/activityDetail?id=<%= actives[i].activeId %>">
                                    <%= actives[i].subject %>
                                </a>
                            </td>
                            <td><%= actives[i].startTime %></td>
                            <td><%= actives[i].endTime %></td>
                            <% if(actives[i].activeStatus == 1){ %>
                                <td>未开始</td>
                            <% } %>
                            <% if(actives[i].activeStatus == 2){ %>
                                <td>进行中</td>
                            <% } %>
                            <% if(actives[i].activeStatus == 3){ %>
                                <td>已结束</td>
                            <% } %>
                            <% if(actives[i].admitStatus == 1){ %>
                                <td>邀请未确认</td>
                            <% } %>
                            <% if(actives[i].admitStatus == 2){ %>
                                <td>邀请同意</td>
                            <% } %>
                            <% if(actives[i].admitStatus == 3){ %>
                                <td>邀请被拒绝</td>
                            <% } %>
                            <% if(actives[i].admitStatus == 4){ %>
                                <td>申请未审核</td>
                            <% } %>
                            <% if(actives[i].admitStatus == 5){ %>
                                <td>申请已批准</td>
                            <% } %>
                            <% if(actives[i].admitStatus == 6){ %>
                                <td>申请被拒绝</td>
                            <% } %>
                            <% if(actives[i].admitStatus == 7){ %>
                                <td>未出席</td>
                            <% } %>
                            <% if(actives[i].admitStatus == 8){ %>
                                <td>已出席</td>
                            <% } %>
                            <td><%= actives[i].location %></td>
                            <td><%= actives[i].applyTime %></td>
                            <td>
                                <% if(actives[i].activeStatus == 1){ %>
                                    <% if(actives[i].admitStatus == 1){ %>
                                        <a href="/customer/active/changeAdmitStatus?id=<%= actives[i].id %>&status=2">同意</a>&nbsp;
                                        <a href="/customer/active/changeAdmitStatus?id=<%= actives[i].id %>&status=3">拒绝</a>&nbsp;
                                    <% } %>
                                    <% if(actives[i].admitStatus == 4){ %>
                                        <a href="/customer/active/cancelApply?id=<%= actives[i].id %>">取消报名</a>
                                    <% } %>
                                <%  }   %>
                                <% if((actives[i].admitStatus == 5||actives[i].admitStatus == 2)&&actives[i].activeStatus==2){ %>
                                        <a href="/customer/active/queryQrCode?admitId=<%= actives[i].id %>&activeId=<%= actives[i].activeId %>">查看二维码</a>
                                <% } %>
                            </td>
                        </tr>
                        <% } %>
                    <% }else {%>
                        <tr><td colspan="8" class="text-center"><h1>抱歉 没有符合条件记录</h1></td></tr>
                    <% } %>

                    </tbody>

                </table>

            </div>
            <div class="row">
                <div class="col-md-4 "></div>
                <div class="col-md-6">
                    <ul class="pagination">
                        <li><a href="#">&laquo;</a></li>
                        <li><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a></li>
                        <li><a href="#">&raquo;</a></li>
                    </ul>
                </div>

            </div>

        </div>

    </div>
</div>
</body>
</html>